package com.ssd4.uidesign.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;
import com.ssd4.service.inter.UserAccountInter;
import com.ssd4.uidesign.domain.Useraccount;
import com.ssd4.uidesign.vo.UserAccount;

public class UserAccountAction extends ActionSupport{
	private static UserAccountInter userAccount;

	public void setUserAccount(UserAccountInter userAccount) {
		this.userAccount = userAccount;
	}

	public String execute()
	{
		return "success";
	}
	
	public String UserAccountShow(){
		//获取servlet中的request
		HttpServletRequest request = ServletActionContext.getRequest();		
		List<Useraccount> useraccountlist = userAccount.getResult("from Useraccount where userid=?", new Object[]{new Integer(3)});
		request.setAttribute("useraccountlist", useraccountlist);
		return "success";
	}
}